<?php
defined('SYSPATH') OR die('No direct access allowed.');
/**
 * hasilproses.php
 * @author ranuandra
 *
 * 8 Mei 2012 10:27:58
 *
 * 
 */

class Model_HasilProses extends ORM
{
	
	protected $_belongs_to = array(
							'pelamarproses'		=> array('model' 	=> 'pelamarproses'),
							'user'				=> array('model' 	=> 'user'),
						);
	private $_field = array('pelamarproses_id', 'hasil', 'kode', 'tgl', 'user_id');
	private $_form = array(
							'pelamarproses_id' 	=> '', 
							'kode' 				=> '', 
							'tgl' 				=> '', 
							'hasil'				=> '',
							'user_id' 			=> '', 
						);
	
	public function rules()
	{
		return array(
						'pelamarproses_id' => array(
														array('min_length', array(':value', 0)),
											),
						
							'kode' => array(
															array('min_length', array(':value', 0)),
														), 
							'tgl' => array(
															array('min_length', array(':value', 0)),
														), 
							'hasil' => array(
															array('min_length', array(':value', 0)),
														), 
							'user_id' => array(
															array('min_length', array(':value', 0)),
														), 
		
		); 
	}
	
	public function getField()
	{
		return $this->_field;
	}
	
	public function getForm()
	{
		return $this->_form;
	}
	
	public function create_data($values)
	{
	    return $this->values($values, $this->_field)->create();
	}	
}